
GridDlg.controllerName = "/attendance/overtime";
GridDlg.PrimaryKey = "otId";
GridDlg.formId = "overtime";
/**
 * 用户详情对话框（可用于添加和修改对话框）
 */
GridDlg.validateFields =  {

    otStrDate: {
        validators: {
            notEmpty: {
                message: '开始时间不能为空'
            },
            date: {
                format: 'YYYY-MM-DD hh:mm:ss',
                    message: '开始时间格式错误'
            }
        }
    },
    otEndDate: {
        validators: {
            notEmpty: {
                message: '结束时间不能为空'
            },
            date: {
                format: 'YYYY-MM-DD hh:mm:ss',
                message: '结束时间格式错误'
            }

        }
    },
    otMemo: {
        validators: {
            notEmpty: {
                message: '加班原因不能为空'
            }

        }
    }
};

var initLaydate = function(id) {

    var laydatetime = {
        elem: '#'+id,
        format: 'YYYY-MM-DD hh:mm:ss',
        istime: true,
        istoday: false,
        start: laydate.now(0, "YYYY-MM-DD hh:mm:ss")
    };
    laydate(laydatetime);
}

/**
 * 收集数据
 */
GridDlg.collectData = function () {
    this.set('otId').set('otStrDate').set('otEndDate').set('otMemo');
};

$(function () {
    initLaydate('otStrDate');
    initLaydate('otEndDate');
    Common.initValidator(GridDlg.formId, GridDlg.validateFields);
});
